#ifndef atom_h_
#define atom_h_


class Atom {
 public:
  Atom(const unsigned & n, const unsigned & m);
  ~Atom();
  unsigned N;				
  unsigned Ngroup;	// number of groups
  unsigned *Nm;			// number of atoms per group
  double *rg;

  unsigned N_s;				
  unsigned Ngroup_s;	
  unsigned Nm_s;	
  double rg_s;

  unsigned N_p;
  unsigned Ngroup_p;
  unsigned Nm_p;
  double rg_p;
  unsigned Nbond;
  unsigned **Bond_ends;
  double *Bond_length;
  unsigned *Nstart;
  
	unsigned *flag;
  double *mass;
  double *Mass;

  double **x;
  double **v;
  double **f;
  double **xcen;
  double **vcen;
  double **fcen;
  double **xrel;
  double **vrel;
  int **boxfold;
  unsigned **group;
  double rcut;

  double boxx;
  double boxy;
  double boxz;
  double pe;
  double temperature;
  double dt;
  double dis_sq(int i, int j);
  double temper();
  double gyration(unsigned &igroup);
  void center(double *r0, unsigned &igroup);
  void period_bd();
  void group_init();
  void x_init();
  void x_group_init();
  void v_init(double &Temp);
  void v_group_init(double &Temp);
  bool check(unsigned i, double **x0, double rc);
  bool check2(double *ch, unsigned i, double **x0, double rc);

  //statistical function for diffusion viscosity etc
  double **diff;
  double **visc;
  double **xcen0;
  double **x0;
  double **vcen0;
  double **v_corr;
  unsigned dfdt;
  unsigned dft;
  double stress0;
  void diffusion(unsigned &loop);
  
  double *r_dis;
  int N_radial;
  double r_radial;
  int r_dis_num;
  void radial_distribution();

  int velocitybin;
  double **veldis;
  void velocity_distribution();

  //statistical distribution of number of particle round a particle
  unsigned *particle_number;
  unsigned *pnumber_dis;
};

int nint(double x);


#endif
